package com.sf.fy.uav.common.enums;


import lombok.Getter;

/**
 * @author ta136817
 */

@Getter
public enum CouponGetOrUseStatusEnum {
    /**
     * 状态 0: 待领取 1:未使用 2:已使用 3:已过期
     */
    NOT_RECEIVE("待领取", 0),
    NOT_USED("未使用", 1),
    USED("已使用", 2),
    EXPIRED("已过期", 3),
    INVALID("已核销", 4);
    private String desc;
    private Integer value;

    public void setValue(Integer value) {
        this.value = value;
    }

    CouponGetOrUseStatusEnum(String desc, Integer vaule) {
        this.desc = desc;
        this.value = vaule;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDesc(Integer value) {
        for (CouponGetOrUseStatusEnum ele : values()) {
            if (ele.getValue().equals(value)) {
                return ele.getDesc();
            }
        }
        return null;
    }
}